﻿<%@ Page Title="用户管理" Language="C#" MasterPageFile="~/Web/Main.Master"  AutoEventWireup="true" CodeBehind="sysUserManage.aspx.cs" Inherits="BOMS.WebUI.sysUserManage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="/Js/Dialog.js"></script>
<script type="text/javascript">
function zOpen(op, userId) {
    //项目Id
   
    var Url;
    if (op == "add") {
        Url = "sysAddUser.aspx?userId=" + userId;
    }
    else if (op == "changeRole") {
        Url = "sysAddUser.aspx?userId=" + userId;
    }  

    //调用div弹出窗口
    var diag = new Dialog("Diag2");
    diag.Width = 540;
    diag.Height = 280; 
    diag.Title = "用户管理操作窗口";
    diag.URL = Url+"&rdm=" + Math.random();
    diag.OKEvent = callback;    //点击确定后调用的方法
    diag.CancelEvent = callback;
    diag.show();
}
function callback(obj) {
    //debugger;
    if (obj.DialogArguments["returnValue"] == "true") {
        setTimeout("document.location.href += '';", 1000);   //保存成功后，刷新父页面
        //debugger;
    } else {
        // do nothing.
    }
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="gv">
    <div class="gvtop">
        <span>系 统 用 户 管 理</span>
        <b><input id="Button2" class="addbg" type="button" onclick="zOpen('add',0);"/></b>
    </div>
    <asp:GridView ID="GridView_User" runat="server" AutoGenerateColumns="False" DataKeyNames="id" 
    onrowcommand="GridView_User_RowCommand" onrowdatabound="GridView_User_RowDataBound" GridLines="None" 
    CssClass="gvstyle" HorizontalAlign="Center" CellSpacing="1" width="100%">
        <Columns>
            <asp:BoundField DataField="name" HeaderText="姓名" />
            <asp:BoundField DataField="userName" HeaderText="账号" />
            <asp:BoundField DataField="role" HeaderText="角色" />
            <asp:ButtonField ButtonType="Button" CommandName="changeRole" HeaderText="编辑账号" Text="编辑" />
            <asp:ButtonField ButtonType="Button" CommandName="resetPwd" HeaderText="重置密码" Text="重置" />
            <asp:ButtonField ButtonType="Button" CommandName="delUser" HeaderText="删除" Text="删除" />
        </Columns>
            <FooterStyle CssClass="FooterStyle" />
            <RowStyle CssClass="gvrowstyle" />
            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
            <PagerStyle CssClass="PagerStyle" />
            <SelectedRowStyle CssClass="SelectedRowStyle" />
            <HeaderStyle CssClass="gvtitle" />
            <EditRowStyle CssClass="EditRowStyle" />
            <AlternatingRowStyle CssClass="gvalternatingrowstyle" />
    </asp:GridView>
</div>
</asp:Content>
